package cn.minhx.lab.design_patterns.state.f2.starter;

import cn.minhx.lab.design_patterns.state.f2.StateHandler;
import cn.minhx.lab.design_patterns.state.f2.Status;
import cn.minhx.lab.design_patterns.state.f2.vo.ActivityService;
import cn.minhx.lab.design_patterns.state.f2.vo.Result;
import com.alibaba.fastjson2.JSON;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Main {
    private static final Logger logger = LoggerFactory.getLogger(Main.class);

    public static void main(String[] args) {
        test_Editing2Arraignment();
    }

    public static void test_Editing2Arraignment() {
        String activityId = "100001";
        ActivityService.init(activityId, Status.Editing);
        StateHandler stateHandler = new StateHandler();
        Result result = stateHandler.arraignment(activityId, Status.Editing);
        logger.info("测试结果(编辑中To提审活动)：{}", JSON.toJSONString(result));
        logger.info("活动信息：{} 状态：{}", JSON.toJSONString(ActivityService.queryActivityInfo(activityId)), JSON.toJSONString(ActivityService.queryActivityInfo(activityId).getStatus()));
    }

}
